package guidointegrador;

import br.ufpe.cin.miniJava.gui.Component;
import br.ufpe.cin.miniJava.gui.listener.ClickListener;

public class RemoverPousadasListener implements ClickListener{

	RemoverPousada panel;
	
	
	public RemoverPousadasListener(RemoverPousada p) {
		panel = p;
	}


	public void clickEvent() {
		
	}


	public void clickEvent(Component componente) {
		if(componente==panel.botaoD)
		   {
			
			if(panel.comboPousadas.nomePousadas.length != 0){
				   String nome = panel.comboPousadas.getPousada();
				   try {
					panel.cadastro.remover(nome);
					panel.comboPousadas.atualizar(panel.cadastro.getRepositorio());
				} catch (Exception e) {
					e.printStackTrace();
				} 
				
				
				
			   }
			}
				
	}


	
	
	
	
}
